package com.kedi.welfarecenter.read.dao.mapper;


import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 
 *
 * @ClassName	VolunteerMapper
 * @author: 	dw
 * @date: 		2019/7/26	14:41
 */
@Mapper
public interface VolunteerMapper {
	
	/**
	 * 				获取志愿者信息		
	 * @return		findList
	 */
    @Select("select volunteer,title,status,post,specifictime from volunteer")
    List<Map> findList();
    
    /**
     * 				根据id获取志愿者对应得志愿者报名人信息
     * @param 		id
     * @return		findDitail
     */
    @Select("select title,content,start_time,end_time,i.address,phone,enlist,enrequire,v.address as volunteeraddress,specifictime from volunteer v left join\n" +
            " imagesource i on i.volunteer = v.volunteer where v.volunteer=#{id}")
    Map<String,Object> findDitail(@Param("id") Integer id);

}
